package com.junqson.je.content.controller;

import com.junqson.je.common.model.ApiResult;
import com.junqson.je.content.service.SectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Descriptions
 * @Company
 * @Author Junqson
 * @Date 2020/2/11 10:52
 * @Version 1.0
 */
@RequestMapping("section")
@RestController
public class SectionController {

    @Autowired
    private SectionService sectionService;


    @RequestMapping("list")
    public ApiResult allSection() {
        return ApiResult.success(sectionService.getAllSection());
    }

    @RequestMapping("add")
    public ApiResult addSection(String sectionName) {
        sectionService.addSection(sectionName);
        return ApiResult.success();
    }
}
